//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Research.DataLayer;

namespace TridentConnectionManagerEditor
{
    class ConfigEditor : ConnectionManagerEditor.ConfigEditor
    {
        internal ConfigEditor(string[] args, Type agents,
            ConnectionManagerEditor.ConfigEditor.ConnectionManagerCreator creator)
            : base(args, agents, creator)
        {
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            ConfigEditor cfg = new ConfigEditor(args, typeof(ConnectionManager.Agent),
                new ConnectionManagerEditor.ConfigEditor.ConnectionManagerCreator(
                    delegate(string file, object agent, ConnectionManagerBase.ConfigScope scope) {
                        if (agent == null)
                        {
                            return ConnectionManager.Create(ConnectionManager.CancelBehavior.SilentlyReturnNull, scope);
                        }
                        else
                        {
                            return ConnectionManager.CreateForAgent(ConnectionManager.CancelBehavior.SilentlyReturnNull,
                                (ConnectionManager.Agent)agent);
                        }
                    }));
            cfg.Run();
        }
    }
}
